package com.hzgj.bcl.util;

import com.google.common.collect.Sets;

import java.util.Map;
import java.util.Set;

public class MapUtil {

    public static <K, V> void putMapValue(Map<K, Set<V>> servers, K referenceDef, V value) {
        servers.compute(referenceDef, (key, cols) -> {
            if (cols == null) {
                cols = Sets.newHashSet();
            }
            cols.add(value);
            return cols;
        });
    }
}
